package com.kefu.robot.vo;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import com.kefu.robot.model.RobotAidataRecording;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author xiaoyu
 * @date 2023/11/17
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "AI大模型记录")
public class RobotAidataRecordingUpdateVo extends AbstractUpdateVo<RobotAidataRecording,String> {

    @NotEmpty
    @ApiModelProperty(value = "主键")
    private String recordingId;
    @ApiModelProperty(value = "问题")
    private String question;
    @ApiModelProperty(value = "大模型回答")
    private String answer;
    @ApiModelProperty(value = "会话id")
    private String session;

    @Override
    public RobotAidataRecording convert() {
        RobotAidataRecording info  = BeanUtil.toBean(this, RobotAidataRecording.class);
        KefuContext context = KefuContext.getKefuContext();
        info.setUpdateTime(context.getNow());
        info.setUpdateUser(context.getUserId());
        return info;
	}
}